package com.yyaccp.appinfo.controller;

import com.yyaccp.appinfo.service.AppCategoryService;
import com.yyaccp.appinfo.utils.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/appCategory")
public class AppCategoryController {
    @Autowired
    private AppCategoryService appCategoryService;

    @RequestMapping("/categoryName")
    public AjaxResult categoryLevel(Integer parentId) {
        return AjaxResult.success(appCategoryService.selectByParentId(parentId));
    }
    @RequestMapping("/categoryName2")
    public AjaxResult categoryLevel2(Integer id) {
        return AjaxResult.success(appCategoryService.selectById(id));
    }
}
